﻿using BIS.Utility.DAL.DataMapper;
using BIS.Utility.Converter;

namespace BIS.Portal.Modules.CMS.Entity
{
    public class ClientCmsMenuEnity : IEntity
    {

        #region Private member
        private int _category_id;
        private string _category_name;
        private string _category_page_alias;
        private int _parent_category_id;
        private int _category_type;
        private int _use_direct_url;
        private string _category_direct_url;
        #endregion

        #region Pulbic contructor

        public ClientCmsMenuEnity()
        {
        }

        public ClientCmsMenuEnity(int categoryId, string categoryName, string categoryPageAlias, int parentCategoryId, int categoryType, int useDirectUrl, string categoryDirectUrl)
        {
            _category_id = categoryId;
            _category_name = categoryName;
            _category_page_alias = categoryPageAlias;
            _parent_category_id = parentCategoryId;
            _category_type = categoryType;
            _use_direct_url = useDirectUrl;
            _category_direct_url = categoryDirectUrl;
        }

        #endregion

        #region Pulbic properties

        public virtual int CategoryId
        {
            get { return _category_id; }
            set { _category_id = value; }
        }

        public virtual string CategoryName
        {
            get { return _category_name; }
            set { _category_name = value; }
        }

        public virtual string CategoryPageAlias
        {
            get { return _category_page_alias; }
            set { _category_page_alias = value; }
        }

        public virtual int ParentCategoryId
        {
            get { return _parent_category_id; }
            set { _parent_category_id = value; }
        }

        public virtual int CategoryType
        {
            get { return _category_type; }
            set { _category_type = value; }
        }

        public virtual int UseDirectUrl
        {
            get { return _use_direct_url; }
            set { _use_direct_url = value; }
        }

        public virtual string CategoryDirectUrl
        {
            get { return _category_direct_url; }
            set { _category_direct_url = value; }
        }

        #endregion

        #region Implement From IEntity Member

        public void Fill(System.Data.IDataReader reader)
        {
            CategoryId = Functions.GetInt(reader["category_id"]);
            CategoryName = Functions.GetString(reader["category_name"]);
            CategoryPageAlias = Functions.GetString(reader["category_page_alias"]);
            ParentCategoryId = Functions.GetInt(reader["parent_category_id"]);
            CategoryType = Functions.GetInt(reader["category_type"]);
            UseDirectUrl = Functions.GetInt(reader["use_direct_url"]);
            CategoryDirectUrl = Functions.GetString(reader["category_direct_url"]);
        }
        #endregion

    }
}
